home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hunter 2006
/
Hunter 2006.iso
/
soft
/
sleipnir241.exe
/
{app}
/
scripts
/
ƒ†[ƒeƒBƒŠƒeƒB
/
”CˆÓ‚̃tƒHƒ‹ƒ_‚ɃVƒ‡[ƒgƒJƒbƒg‚ðì¬.vbs
< prev
next >
Wrap
Text File
|
2006-06-15
|
3KB
|
92 lines
'***************************************************************
'
' öCê╙é╠âtâHâïâ_é╔âVâçü[âgâJâbâgé≡ì∞ɼüi2002/09/06üj
' written by sleepy
'
'***************************************************************
Option Explicit
Dim objWshShell, objEnv, obj, document, id, ROOT_DIR, TEMP_DIR
Set objWshShell = WScript.CreateObject("WScript.Shell")
Set objEnv = objWshShell.Environment("Process")
Set obj = CreateObject("Sleipnir.API")
id = obj.GetDocumentID(obj.ActiveIndex)
Set document = obj.GetDocumentObject(id)
'ò█æ╢â_âCâAâìâOé╠rootâfâBâîâNâgâè(ROOT_DIR)é╞êΩÄ₧ò█æ╢âfâBâîâNâgâè(TEMP_DIR)é╠É▌ÆΦ
ROOT_DIR = ""
TEMP_DIR = ""
If document Is Nothing Then
Call obj.MessageBox("Document é≡ì∞ɼé┼é½é▄é╣é±")
Else
Dim objRegExp, objShell, objExistsCheck, objFolder, objURLShortcut
Dim ShortcutDir, RDir, PageURL, PageTitle
If TEMP_DIR = "" Then
TEMP_DIR = objEnv.Item("TEMP")
End If
If Right(TEMP_DIR, 1) = "\" Then
TEMP_DIR = Left(TEMP_DIR, Len(TEMP_DIR) - 1)
End If
Set objRegExp = New RegExp
objRegExp.Pattern = "\\|\/|:|,|;|\*|\?|""|<|>|\|| "
objRegExp.IgnoreCase = True
objRegExp.Global = True
PageTitle = objRegExp.Replace(CStr(Trim(document.title)), "")
Set objRegExp = Nothing
ShortcutDir = TEMP_DIR & "\" & PageTitle & ".url"
PageURL = obj.URL
Set objShell = WScript.CreateObject("Shell.Application")
Set objExistsCheck = WScript.CreateObject("Scripting.FileSystemObject")
If ROOT_DIR = "" Then
RDir = 0
Else
If Right(ROOT_DIR, 1) = "\" Then
ROOT_DIR = Left(ROOT_DIR, Len(ROOT_DIR) - 1)
End If
RDir = ROOT_DIR
End If
Set objFolder = objShell.BrowseForFolder(0, "ò█æ╢é╖éΘâtâHâïâ_é≡ÄwÆΦé╡é─ë║é│éóüB", &h0040, RDir)
If Not objFolder Is Nothing Then
Set objURLShortcut = objWshShell.CreateShortcut(ShortcutDir)
objURLShortcut.TargetPath = PageURL
objURLShortcut.Save
Set objURLShortcut = Nothing
If objExistsCheck.FileExists(ShortcutDir) Then
On Error Resume Next
objFolder.MoveHere ShortcutDir, &h0400
Else
obj.MessageBox("ÄwÆΦâtâHâïâ_é╓é╠ò█æ╢é╔Ä╕ösé╡é▄é╡é╜üB")
End If
End If
If objExistsCheck.FileExists(ShortcutDir) Then
obj.MessageBox("ÄwÆΦâtâHâïâ_é╓é╠ò█æ╢é╔Ä╕ösé╡é▄é╡é╜üB")
'Ä╕ösé╡é╜Ä₧üAêΩÄ₧ò█æ╢âtâHâïâ_é╠âVâçü[âgâJâbâgé≡Äcé╡é╜éóÅΩìçé═é▒é╠ë║é╠éPìsé≡âRâüâôâgâAâEâgé╡é─ë║é│éóüB
objExistsCheck.DeleteFile ShortcutDir, False
Err.Clear
On Error Goto 0
End If
Set objFolder = Nothing
Set objExistsCheck = Nothing
Set objShell = Nothing
Set document = Nothing
End If
Set objEnv = Nothing
Set objWshShell = Nothing
Set obj = Nothing